While we watched our colleagues Chris and Ben take the formidable road of SSH and terminal commands in their instructions, herein lies the saga of an Ecologist navigating the road of computational biology but avoiding the fork towards computer science. Follow this guide step by step and you will have a model running on a server with little understanding of what is happening.
e.g. http://www.louisaslett.com/RStudio_AMI/, I used the "ami-0acd2067" server for US east coast, VA. This
server has Rstudio, jags, dropbox, github amongst other things already installed.
(if you need something else, there are plenty of other servers to choose from. if you
feel so inclined, you can use a linux based AMI and install everything yourself)
-on your instance page select the alarm icon under "alarm status"
-create an alarm:
+ check box next to "send notification to"
+ select create topic next to "send notification to"
+ create topic name
+ send notificaton to: your email
+ check box next to "take the action"
+ select what you want to happen when model is running. Most likely you want "stop this instance".
Don't mistake it for "terminate this instance" which will just delete everything that you did
+complete when you want the notification and stop to happen. I've found that "Whenever _Average_
of _CPU Utilization_ is _< 10%_ for at least _1_ consecutive period of _15_
_minutes_" seems to work pretty well for my purposes, but you may want a longer amount of time of
inactivity depending on what it is you're doing.I've found that I don't work fast enough in setting
up my model runs to go with the 5 minute interval of inactivity for instance stopping.
I recommend not setting an alarm until you’ve set everything up and have it running as setup work tends to not use much CPU.
Note: If you use the free tier instance, there is only one core. This means that if you close the tab while R is running commands, you can not reload it until its finished because the instance is too busy with R tasks to respond to your requests to the server.
Do this exactly as you normally would when starting a project in R: Go to File –> new project –> version control –> git –> enter repository URL (can get this via green “clone or download” button on top right of github repository) –> create project –> you will have to enter your github details (username, password) as usual.
This code needs to be run before uploading any projects from github because of the way that the function was written by the AMI creator.
require(RStudioAMI)
linkDropbox() #open a tab to allow access
excludeSyncDropbox("*") #stop syncing everything
This will give you a link in the working console to copy over and to give permission to AMI to access dropbox.
includeSyncDropBox("dropboxFolderName") #sync the folder that you want to upload your results to
This bit of code can go at the end of your model to save your model run(s) in your dropbox. Just switch out
save(file="~/Dropbox/<folderName>/outputFileName.Rdata", list="nameOfJagsOutput") #save model output in that folder on dropbox
-select the "load" button and load your saved key file. (what you saved in step 10 of the first section)
you may need to change file type to all files to see the .pem file.
-save as private key (.ppk) - this file name needs to be *EXACTLY THE SAME* as they key that you saved in
step 11 above, otherwise an error occurs later in your PuTTY connection
-close PuTTYgen
(public dns will only show if instance is running)
connection type: ssh
port: 22